//Standard Headers
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

//External headers
#include <unistd.h>
#include <sys/ioctl.h>
#include <termios.h>

//Local Headers
#include "cards.h"

/*Notes:
 * exit status 3 = Terminal Size insuficient*/

void verify_terminal_size(void) {
	//see linux manual page ioctl_tty
	struct winsize win;
	ioctl(STDOUT_FILENO, TIOCGWINSZ, &win);
	if(win.ws_row < 25 || win.ws_col < 120) {
		printf("Terminal Size insuficient: minimum 50 rows and 120 colums\n");
		exit(3);
	}
}


void draw();
void input();

void main_Loop();

void main_menu(int *state) {
	printf("1->New Game\n2->Deck Editor\n3->Quit");
	scanf("%d", state);
}

int main(void) {
	
	verify_terminal_size();

	struct winsize win;
	win.ws_row=25;
	win.ws_col=120;
	int state = 0; //1-> MENU, 2-> DECK EDITOR 3-> DUEL
	/*i can use this state to alter the behavior of the
	 *draw and the input function*/
	cards_ptr * test = get_cards();
	printf("%s \n", ((struct Monster_Card*)test->card)->name);
		
	return 0;
}
